package com.service;

import com.mapper.VideoMapper;
import com.pojo.Video;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("video")
public class VideoService {
    @Resource
    private VideoMapper dao;
    public void UploadVideo(Video video){
        dao.insert(video.getId(),video.getOpposite(),video.getSupport(),video.getTittle(),video.getRemarknum(),video.getCollectionnum(),video.getUserid(),video.getIntroduce(),video.getUploadtime(),video.getFlag(),video.getCategoryid());
    }
    public int selectMaxId(){
        if (dao.selectMaxId()==null)
            return 0;
        else
            return dao.selectMaxId();
    }
    public List<Video> selectUserVideo(int id){
        return dao.selectUserVideo(id);
    }
}
